home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 2004 #11
/
Amiga Plus CD - 2004 - No. 11.iso
/
AmiSoft
/
Dev
/
misc
/
temgen.lha
/
Temgen
/
tg-0.11
/
sample
/
class
/
classdef.tg
< prev
next >
Wrap
Text File
|
2002-12-18
|
1KB
|
63 lines
#
# simple C++ example
#
#
# class - open class declaration
#########################################################
@function class( name )
@ emit $name + ".Header"
class $name {
private:
@ embed $name + ".p"
public:
@ embed $name + "."
};
@output( $name + ".h" )
\#ifndef __$name\_h_
\#define __$name\_h_
@ embed $name + ".Header"
\#endif
@output( $name + ".cc" )
\#include \"$name\.h\"
@ embed $name + ".Body"
@endfunction
#
# private - make private method
#########################################################
@function private( class, typ, proto )
@ emit $class + ".p"
$typ $proto ;
@ emit $class + ".Body"
$typ $class::$proto
{
@ embed $class + ".Fun." + $typ + ":" + $proto
}
@ emit $class + ".Fun." + $typ + ":" + $proto
@endfunction
#
# public - make public method
#########################################################
@function public( class, typ, proto )
@ emit $class + "."
$typ $proto ;
@ emit $class + ".Body"
$typ $class::$proto
{
@ embed $class + ".Fun." + $typ + ":" + $proto
}
@ emit $class + ".Fun." + $typ + ":" + $proto
@endfunction